package starter.actions;

import net.serenitybdd.annotations.Step;
import net.serenitybdd.core.steps.UIInteractionSteps;
import starter.pageobjects.HomePage;

/**
 * @ClassName HomepageSteps
 * @Date 2024/8/5 15:37 56
 * @Author Jack Chen
 * @Description serenity-cucumber-page-objects-starter-master
 * @Version 1.0
 */

public class HomepageSteps extends UIInteractionSteps {

    HomePage homePage;

    @Step("User opens the Shopping home page")
    public void openShoppingHomePage() {
        homePage.open();
    }

    @Step("click on logon button")
    public void clickOnLogonButton() {
        homePage.clickOnLogonBtn();
    }

    @Step("click on user center link")
    public void clickOnUserCenterLink() {
        homePage.clickOnUserCenterLink();
    }

    @Step("switch to logon window frame")
    public void switchToLogonWindowFrame() {
        homePage.switchToLoginFrame();
    }

    @Step("enter user name in pop window")
    public void enterUserNameInPopWindow(String username) {
        homePage.usernameInputFieldPop(username);
    }

    @Step("enter password in pop window")
    public void enterPasswordInPopWindow(String password) {
        homePage.passwordInputFieldPop(password);
    }

    @Step("click logon button in pop window")
    public void clickLogonSubmitInPopWindow() {
        homePage.clickOnUserLoginBtnPop();
    }
}
